<template>
  <div class="treasureChest_3">
    <!-- 顶部页面标题栏 -->
    <!-- <div class="header">
      <div class="backIcon" @click="back">
        <img slot="icon" src="../../assets/transfer/backIcon.png" class="iconImage" />
      </div>
      <div class="theme">计生</div>
    </div>-->

    <!-- 页面主体信息区域 -->
    <div class="outermostMargin">
      <div class="carousel">计生</div>

      <div class="contect">
        <van-cell :value="thirdPageData.dutyUserName">
          <!-- 使用 title 插槽来自定义标题 -->
          <template slot="title">
            <span class="custom-title">负责人</span>
          </template>
        </van-cell>

        <van-cell
          class="rightIcon"
          title="联系我"
          :value="thirdPageData.phone"
          @click="callOut(thirdPageData.phone)"
        >
          <div style="line-height: 40px;display: flex;justify-content: flex-end;">
            <div style="align-items:center;margin-right: 15px;">{{thirdPageData.phone}}</div>
            <div>
              <img src="../../assets/treasureChest/thiredP/phoneIcon765.png" />
            </div>
          </div>
        </van-cell>
      </div>

      <div class="to-do">
        待办事项
        <p v-for="(i, index) in thirdPageData.list" :key="index">{{i.title}}</p>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "treasureChest_3",
  data() {
    return {
      thirdPageData: {
        dutyUserName: "扬武彬",
        phone: "",
        list: [
          { title: "1. 居民证办理" },
          { title: "2. 江苏省实施全面两孩正常问答" }
        ]
      }
    };
  },
  created() {
    if (this.$route.query.thirdPageData != undefined) {
      this.thirdPageData = this.$route.query.thirdPageData;
    }
  },
  methods: {
    back() {
      this.$router.isBack = true; // 将返回状态置为触发态，以边路由监听触发返回动画
      this.$router.back(); // 路由向后退一步
    },

    callOut(phoneNum) {
      if (phoneNum === "" || phoneNum === undefined) {
        Dialog.alert({
          title: "无联系电话",
          message: "该服务尚未配置联系电话"
        }).then(() => {
          // on close
        });
      } else {
        this.$dialog
          .confirm({
            title: "拨打电话",
            message: "是否拨号：" + phoneNum
          })
          .then(() => {
            window.location.href = "tel://" + phoneNum;
          })
          .catch(() => {});
      }
    }
  }
};
</script>
<style lang="scss" scoped>
@import "~@/smobile.scss";
.treasureChest_3 {
  .header {
    padding: $sm-spaceing-block-sm 0 $sm-spaceing-block-sm 0;

    position: absolute;
    width: $sm-img-per-max;
    height: 21px;
    background: $sm-bg-color;
    z-index: 2;

    display: flex;
    flex-direction: row nowrap;
    justify-content: flex-start;
    .backIcon {
      position: absolute;
      white-space: nowrap;
      height: $sm-icon-px-md;
      z-index: 4;

      .iconImage {
        height: $sm-icon-px-md;
        width: $sm-icon-px-md;
        transform: rotateY(180deg);
      }
    }

    .theme {
      position: absolute;
      font-weight: bold;
      width: $sm-img-per-max;
      text-align: center;
      white-space: nowrap;
      z-index: 3;
    }
  }

  .outermostMargin {
    background: $sm-bg-color-grey;
    color: $sm-text-color;
    font-size: $sm-font-size-lg;

    overflow: auto;
    height: 100vh;
    // margin: 41px 0 0 0;

    .carousel {
      margin: 0;
      padding: 0;
      height: $sm-img-per-xm;
      width: $sm-img-per-max;

      background-image: url("../../assets/treasureChest/thiredP/violet03.png");
      background-repeat: no-repeat;
      background-size: cover;

      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      color: $sm-text-color-inverse;
      font-size: $sm-font-sizeVH-base;
    }
    .contect {
      margin: 0 0 $sm-spacing-col-base 0;
      .rightIcon {
        .van-cell__value {
          display: flex;
          flex-direction: row;
          justify-content: flex-end;
          align-items: center;
          img {
            height: $sm-img-size-md;
          }
        }
      }
    }
    .to-do {
      background-color: $sm-bg-color;
      text-align: center;
      padding: $sm-spaceing-block-sm;
    }
  }
}
</style>